package com.agentai.framework.common.exception;

import com.baomidou.lock.LockFailureStrategy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/**
 * * 锁获取失败策略
 * @Author yangfei
 * @Description
 * @Date 2024/11/25 14:13
 */
@Slf4j
@Component
public class RedisLockFailureStrategy implements LockFailureStrategy {
    @Override
    public void onLockFailure(String key, Method method, Object[] arguments) {
        log.error((null!= method)?method.getName():""+"中redission锁-"+key+"，获取失败 ");
        throw new ServerException("业务处理中,请稍后再试");
    }
}
